<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue学习/vue.js"></script>
</head>

<body>
    <!-- 创建vue组件 -->
    <div id="app">
        <goods></goods>
        <goods2></goods2>
    </div>
    <!-- 1.编写模板代码 -->
    <script type="text/x-template" id="t1">
        <div>
            <p>模板内容</p>
        </div>
    </script>
    <!-- 第二种写法 模板代码 -->
    <template id="t2">
      <div>
        <p>第二种写法</p>
        <p>第二种写法</p>
      </div>
    </template>

    <script>
        //2.全局注册
        Vue.component("goods", {
            template: "#t1"
        });
        Vue.component("goods2", {
            template: "#t2"
        })

        new Vue({
            el: "#app",
            data: {

            }
        });
    </script>
</body>

</html>